#coding=utf-8
from pymongo import MongoClient
class record:
    def __init__(self):
        self.client=MongoClient("localhost",27017)
        self.db=self.client.klbr
        self.collection=self.db.klbr_record
    
    def add(self,data):
        try:
            self.collection.insert(data)
        except Exception:
            print "插入数据失败，url="+data["url"]